﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace planetExpressLib
{
    public class actividadCAD
	{
        //Me permite obtener la cadena de conexión del webconfig
        static string conStr = ConfigurationManager.ConnectionStrings["DatabaseConnection"].ConnectionString;
        SqlConnection con = new SqlConnection(conStr);

        public actividadEN insertAct(actividadEN act)
        { return null; }
        public actividadEN updateAct(int id)
        { return null; }
        public actividadEN deleteAct(int id)
        { return null; }
        public actividadEN mostrarAct(int id)
		{ return null; }

        public DataTable gridviewActvListaCAD(string nombre)
        {

            DataTable bdVirtual = new DataTable();
            string comando = "SELECT Actividad FROM ACTIVIDAD WHERE (Id = (SELECT Id FROM ACTIVIDAD_PLANETA WHERE (Planeta = (SELECT Id FROM PLANETA WHERE (Nombre = '" + nombre + "')))";
            SqlCommand cmd = new SqlCommand(comando, con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(bdVirtual);

            return bdVirtual;
        }

	}
}
